﻿using GGetTestService.Common.ApiResult;
using GGetTestService.Services.Interface;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace GGetTestService.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ClassesController : ControllerBase
    {
        private readonly IClassesService _classesService;

        public ClassesController(IClassesService classesService)
        {
            _classesService = classesService;
        }

        [HttpGet(nameof(GetClassesIncludeTeacherAndStudents))]
        public async Task<ActionResult<ApiResult>> GetClassesIncludeTeacherAndStudents()
        {
            var list= await _classesService.GetClassesIncludeTeacherAndStudents();
            return ApiResultHelper.Success(list);
        }
    }
}
